package com.utils;

import android.content.Context;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;

//import com.example.dailm.service.BackService;

public class MonitorView extends View {
    private static final String LOG_TAG = "MonitorView";
    private Context parentView = null;
    public MonitorView(Context context) {
        super(context);
        parentView = context;

    }

    @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        Log.d("suhuazhi", "keyCode " + event.getKeyCode());
        return super.dispatchKeyEvent(event);
    }
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_BACK:
               // Log.i(LOG_TAG, "KeyEvent.KEYCODE_BACK");
              //  callMenu.closeAPk("com.kugou.android",parentView);

                break;
            case KeyEvent.KEYCODE_MENU:
              //  Log.i(LOG_TAG, "KeyEvent.KEYCODE_MENU");
                break;
            case KeyEvent.KEYCODE_VOLUME_DOWN:
               // Log.i(LOG_TAG, "音量减小");
                break;
            case KeyEvent.KEYCODE_VOLUME_UP:
               // Log.i(LOG_TAG, "音量增大");
                break;
            default:
                break;
        }
        return super.onKeyDown(keyCode, event);
    }
    @Override
    public boolean onKeyUp(int keyCode, KeyEvent event) {

        return super.onKeyUp(keyCode, event);
    }
}